﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ThreeByte.ActiveDeck.Content
{
    public class TransitionType
    {

        public static readonly TransitionType Fade = new TransitionType("Fade");
        public static readonly TransitionType Cut = new TransitionType("Cut");
        public static readonly TransitionType Swipe = new TransitionType("Swipe");
        public static readonly TransitionType Curl = new TransitionType("Curl");
        public static readonly TransitionType Flip = new TransitionType("Flip");
        public static readonly TransitionType Default = Fade;

        //public static readonly IList<TransitionType> TransitionTypes = new TransitionType[] { Fade, Cut, Swipe, Curl, Flip };

        private string Name;

        private TransitionType(string name) {
            Name = name;
        }

        public override string ToString() {
            return Name;
        }

        public static TransitionType Parse(string type) {

            foreach(TransitionType t in new TransitionTypes()) {
                if(t.Name == type) {
                    return t;
                }
            }

            throw new ArgumentOutOfRangeException("type", "Not a recognized TransitionType");
        }
    }

    public class TransitionTypes : List<TransitionType>
    {
        public TransitionTypes() {
            this.Add(TransitionType.Fade);
            this.Add(TransitionType.Cut);
            this.Add(TransitionType.Swipe);
            this.Add(TransitionType.Curl);
            this.Add(TransitionType.Flip);
        }
    }
}
